Azure Bot Service - Part 6 (關於 Language understanding bot)在之前文章中 Azure Bot Services - Part 2(設定 Azure Bot Service), 我們對Azure Bot Service做了基本設定,其中有四個模版(Basic、Form、Language understanding、Proactive)各有其功能,今天就讓我們來認識一下 Language understanding bot
使用 LUIS (natural language models )來了解使用者的意圖,透過訓練 LUIS 辨識 Entity 以及 理解使用者意圖,就可以打造語意辨識的應用程式, 想要了解更多 LUIS 在 bot framework 上的應用可以看 Alarm Bot
因為基於 LUIS 的關係,在選擇 Language understanding bot 這個模版時就必需先建立一個空的 LUIS 應用程式(永遠回傳 None) , 並接著就是要訓練 Luis
使用者發訊息
驗證使用者
1-1. 未通過
回應未驗證
1-2. 通知
執行
Runmethond ofRun.csx
以 ActivityType 決定回應方式
3-1. ActivityTypes.Message:
Processes the user’s message.
BasicLuisDialog of BasicLuisDialog.csx 來處理訊息messageReceived(繼承自LuisDialog),接著呼叫 LUIS 確認意圖 並 執行 BasicLuisDialog.csx 定義的意圖處理方式StartAsync(繼承自LuisDialog) ,呼叫 IDialogContext.Wait
2
3-2. ActivityTypes.ConversationUpdate:
Welcomes the users to the conversation.
3-3. ActivityTypes.ContactRelationUpdate:
3-4. ActivityTypes.Typing:
3-5. ActivityTypes.DeleteUserData:
3-6. ActivityTypes.Ping:
| ActivityType | Description | 
|---|---|
| message | 使用者與 bot 間簡單的文字對話 | 
| conversationUpdate | bot 被加入至新的對談中或是對談的中繼資料有所改變 | 
| contactRelationUpdate | bot 被加入或是移出連絡人清單中 | 
| typing | 使用者或是 bot 在另一方對話結束後正在打字 | 
| ping | 測試 bot 的安全性 | 
| deleteUserData | 使用者要求 bot 刪除使用者相關資料 |